// pages/franchisee/franchisee.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    navList: [{
        id: 1,
        icon: '/images/icon_franchiseeManagement.png',
        name: '加盟商',
        url: '../franchiseees/franchiseeeList/franchiseeeList',
        status: true
      },
      {
        id: 2,
        icon: '/images/icon_cardManagement.png',
        name: '水卡管理',
        url: '../franchiseees/franchiseeeCard/franchiseeeCard',
        status: true
      },
      {
        id: 3,
        icon: '/images/icon_equipmentManagement.png',
        name: '设备管理',
        url: "../equipment/equipment?isfranchiser=1",
        status: true
      },
      {
        id: 4,
        icon: '/images/icon_communityManagement.png',
        name: '园区管理',
        url: '../franchiseees/franchiseeeCommunity/franchiseeeCommunity',
        status: true
      },
      {
        id: 5,
        icon: '/images/icon_templateManagement.png',
        name: '模板管理',
        url: '../template/template?is_franchiser=1',
        status: true
      },
      {
        id: 6,
        icon: '/images/icon_performanceManagement.png',
        name: '业绩管理',
        url: '../franchiseees/franchiseeePerformance/franchiseeePerformance',
        status: true
      },
      {
        id: 7,
        icon: '/images/icon_userManagement.png',
        name: '用户管理',
        url: '../userManagement/userManagement?is_franchiser=1',
        status: true
      },
      {
        id: 8,
        icon: '/images/icon_orderManagement.png',
        name: '订单管理',
        url: '../order/order?is_franchiser=1',
        status: true
      },
      {
        id: 9,
        icon: '/images/icon_accountManagement.png',
        name: '账户管理',
        url: '../franchiseees/franchiseeeAccount/franchiseeeAccount',
        status: true
      }
    ],
    franchiserData: [],
  },



  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var that = this;
    that.franchiserStatistics();
  },


  //加盟商管理统计
  franchiserStatistics() {
    var that = this;
    app.ajax({
      url: 'Partner/Console/franchiserStatistics',
      data: {},
      success: function (res) {
        if (res.data.code == 200) {
          console.info(res);

          that.setData({
            franchiserData: res.data.data
          });
        }
      }
    })
  },
})